<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderTransactionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_transaction', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->integer('type')->unsigned()->comment('支付方式，1是微信支付，2是支付宝');

            $table->decimal('total_fee')->unsigned()->comment('支付金额');

            $table->string('pay_data',500)->comment('支付通知数据打包');

            $table->string('transaction_id',500)->comment('支付方流水号');

            $table->string('order_id_array')->comment('对应的订单表，多个以,号隔开');

        });

        DB::statement("ALTER TABLE `order_transaction` COMMENT='订单交易表'");//表注释


    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_transaction');
    }
}
